home *** CD-ROM | disk | FTP | other *** search
- /* ======================================= *
- file: BitMapper_goodies.h
- date: 11.17.89
- * --------------------------------------- *
- Copyright © 1989, Michael Ogawa — All
- Rights Reserved.
- * ======================================= */
-
- #ifndef _H_BitMapper_goodies
- #define _H_BitMapper_goodies
-
- #ifdef applec
- # include <Types.h>
- # include <Memory.h>
- # include <Errors.h>
- #endif applec
-
- #ifdef THINK_C
- /* #define qDEBUG */
- #endif THINK_C
-
-
- /* constants ============================= */
-
- #ifndef NULL /* also defined in stdio.h */
- # define NULL 0L
- #endif
-
-
- #define kBitsPerByte 8
- #define kBytesPerWord 2
- #define kBitsPerWord \
- (kBitsPerByte * kBytesPerWord)
- #define kWordsPerLWord 2
- #define kBytesPerLWord \
- (kBytesPerWord * kWordsPerLWord)
- #define kBitsPerLWord \
- (kBitsPerByte * kBytesLPerWord)
- /* Generally useful equates of basic data
- element sizes. One byte consists of eight
- bits (kBitsPerByte), one word consists of two
- bytes (kBytesPerWord), and one long word
- consists of two words (kWordsPerLWord) or
- four bytes (kBytesPerLWord). There are 16
- bits in a word (kBitsPerWord), and 32 bits in
- a long word (kBitsPerLWord). */
- /* m_o 09.17.89 */
-
-
- /* data types ============================ */
-
- #ifdef THINK_C
- #define const /* not yet implemented */
- #endif THINK_C
-
-
- /* macro-“functions” ===================== */
-
- #define WIDTH(box) \
- (((box).right) - ((box).left))
- #define HEIGHT(box) \
- (((box).bottom) - ((box).top))
- /* These macros return the width or height
- of the specified rectangle. */
- /* m_o 07.17.89 */
-
-
- #define BITS2ROWBYTES(nBits) \
- ((((nBits) - 1) / kBitsPerWord + 1) \
- * kBytesPerWord)
- /* Converts the number of bits nBits to its
- equivalent number of rowBytes, making sure to
- account for the fact that rowBytes must be
- even. */
- /* mps 07.17.89/m_o 09.17.89 */
-
-
- #endif _H_BitMapper_goodies
-